#include <stdio.h>
#include <string.h>
#include <unistd.h>

#define NUM 102

void bar()
{
  char bar1[NUM];
  memset(bar1,0,sizeof(bar1));

  const char* lable="|/-\\";  //四个字符
  int cnt = 0;
  while(cnt <=100)
  {
    printf("[%-100s][%d%%] %c\r",bar1,cnt,lable[cnt%4]);
    bar1[cnt++]='#';
    fflush(stdout);
    usleep(30000);
  }
  printf("\r");
}


int main()
{
	bar();
	return 0;
}
